<!--
 * @FilePath     : /layui/demo/16-5.html
 * @Description  : 选择后手动上传
 * @Date         : 2025-02-25 13:51
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-02-25 13:51
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <div class="layui-btn-container">
      <button type="button" class="layui-btn layui-btn-normal" id="ID-upload-demo-choose">
        选择文件
      </button>
      <button type="button" class="layui-btn" id="ID-upload-demo-action">开始上传</button>
    </div>

    <script src="/layui/dist/layui.js"></script>
    <script>
      layui.use(function () {
        var upload = layui.upload
        // 渲染
        upload.render({
          elem: '#ID-upload-demo-choose',
          url: '/layui/upload/up1', // 此处配置你自己的上传接口即可
          auto: false,
          // multiple: true,
          bindAction: '#ID-upload-demo-action',
          done: function (res) {
            layer.msg('上传成功')
            console.log(res)
          },
        })
      })
    </script>
  </body>
</html>
